<template>
  <div class=" module article_module">
    <div class="header">
      <div class="title_grp">
        <div class="title_icon"></div>
        推荐文章
      </div>
      <router-link tag="div" class="get_more" to="/articleColumn">
        <span>查看更多 <span class="iconfont icon-getmore-icon"></span></span>
      </router-link>
    </div>
    <article-list :articleList="articleList"></article-list>
  </div>
</template>

<script>
  import ArticleList from 'components/articleList/articleList'
  import {getArticleList} from "../../../api/api";

  export default {
    name: 'Recommend',
    data() {
      return {
        articleList: []
      }
    },
    mounted() {
      this.getRecommend()
    },
    methods: {
      getRecommend() {
        getArticleList(0, 0, 2).then((res)=>{
          res=res.data
          if(res.data){
            this.articleList = res.data
          }
        })
      },

    },
    components: {
      ArticleList
    },

  }
</script>

<style scoped>

  .article_module {

  }

  .module .header {
    width: 100%;
    height: 90px;
    line-height: 90px;
    border-bottom: solid 1px #e5e5e5;
    padding: 0 20px;

  }

  .title_grp {
    width: 200px;
    float: left;
    font-size: 34px;
    font-weight: bold;
    color: black;
    position: relative;
  }

  .title_icon {
    width: 6px;
    height: 34px;
    border-radius: 3px;
    background: #059692;
    float: left;
    margin-top: 28px;
    margin-right: 20px;
  }

  .get_more {
    position: absolute;
    width: 150px;
    right: 10px;
    font-size: 24px;
    color: #c5c5c7;
    text-align: right;
  }

  .get_more .icon-getmore-icon {
    font-size: 36px;
    float: right;
  }

  .article_ul {
    width: 100%;
  }

  li {
    width: 100%;
    padding: 35px 0;
    border-bottom: solid 1px #ededef;

  }

  .article_li {
    height: 215px;
  }

  .article_li .img_grp {
    width: 240px;
    height: 150px;
    float: left;
    border: solid 1px #ededef;
    margin-right: 38px;
    border-radius: 10px;
  }

  .content_grp {
    width: auto;
    position: relative;
  }

  .article_title {
    font-size: 30px;
    color: #333333;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .other_grp {
    font-size: 24px;
    color: #c5c5c7;
    margin-top: 30px;

  }

  .other_grp span {
    width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

</style>
